﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;

namespace IntoMes.Models
{
    public class ProduceData
    {
        public DateTime DateTime { get; set; }
        public string ProductMode { get; set; }
        [Key]
        public string TrayId { get; set; }
        public string Result { get; set; }
        public bool IsRepair { get; set; }
        public string OP10PartCode1 { get; set; }
        public string OP10PartCode2 { get; set; }
        public string OP10PartCode3 { get; set; }
        public string OP10PartCode4 { get; set; }
        public double OP10Torque1 { get; set; }
        public double OP10Torque2 { get; set; }
        public double OP10Torque3 { get; set; }
        public double OP10Torque4 { get; set; }
        public double OP10Angle1 { get; set; }
        public double OP10Angle2 { get; set; }
        public double OP10Angle3 { get; set; }
        public double OP10Angle4 { get; set; }
        public string OP10Result { get; set; }
        public string OP20PartCode1 { get; set; }
        public string OP20PartCode2 { get; set; }
        public string OP20PartCode3 { get; set; }
        public string OP20PartCode4 { get; set; }
        public double OP20Torque1 { get; set; }
        public double OP20Torque2 { get; set; }
        public double OP20Torque3 { get; set; }
        public double OP20Torque4 { get; set; }
        public double OP20Angle1 { get; set; }
        public double OP20Angle2 { get; set; }
        public double OP20Angle3 { get; set; }
        public double OP20Angle4 { get; set; }
        public string OP20Image { get; set; }
        public string OP20Result { get; set; }
        public string OP30PartCode1 { get; set; }
        public string OP30PartCode2 { get; set; }
        public string OP30PartCode3 { get; set; }
        public string OP30PartCode4 { get; set; }
        public double OP30Torque1 { get; set; }
        public double OP30Torque2 { get; set; }
        public double OP30Torque3 { get; set; }
        public double OP30Torque4 { get; set; }
        public double OP30Angle1 { get; set; }
        public double OP30Angle2 { get; set; }
        public double OP30Angle3 { get; set; }
        public double OP30Angle4 { get; set; }
        public string OP30Result { get; set; }
        public double OP50Voltage1 { get; set; }
        public double OP50Voltage2 { get; set; }
        public double OP50Current1 { get; set; }
        public double OP50Current2 { get; set; }
        public double OP50Frequency1 { get; set; }
        public double OP50Frequency2 { get; set; }
        public double OP50Duty1 { get; set; }
        public double OP50Duty2 { get; set; }
        public string OP50FanResult1 { get; set; }
        public string OP50FanResult2 { get; set; }
        public double OP50Presure { get; set; }
        public double OP50Leakage { get; set; }
        public string OP50GasResult { get; set; }
        public string OP50Result { get; set; }
        public string OP60Code { get; set; }
        public string OP60Picture { get; set; }
        public string OP60Result { get; set; }
        public string GP12Result { get; set; }
        public string GP12Code { get; set; }
        
        public string GP12Image1 { get; set; }
        public string GP12Image2 { get; set; }
        public string JZResult { get; set; }
        public string JZImage1 { get; set; }

        public string JZImage2 { get; set; }
        /// <summary>
        /// PLC上一个工位数据
        /// </summary>
        public string LastStationData { get; set; }
    }
    public class ProductionQueryContext : DbContext
    {
        public ProductionQueryContext() : base("ProductionConnection") { }
        public virtual DbSet<ProduceData> Production { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            Database.SetInitializer<ProductionQueryContext>(null);
        }
    }

   

}
